package com.qf.fallback;

import com.qf.feign.GoodsFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@Component
public class GoodsFallbackFactory implements FallbackFactory<GoodsFeign> {

    @Autowired
    GoodsFallback goodsFallback;

    @Override
    public GoodsFeign create(Throwable cause) {
        cause.printStackTrace();
        return goodsFallback;
    }
}
